import com.codezen.vkontakte.VkVideo;

import flash.filesystem.File;

private var settings:Array;

private function saveSettings():void{
	login = login_input.text;
	pass = pass_input.text;
	hdOnly = hd_only_check.selected;
	filterOn = filter_check.selected;
	
	settings['login'] = login;
	settings['pass'] = pass;
	settings['hdonly'] = hdOnly;
	settings['filterOn'] = filterOn;
	
	sets.save(settings);
	
	vkVideoSearch = new VkVideo(login, pass);
	vkVideoSearch.init();
	
	sett_wnd.visible = false;
}

private function loadSettings():void{
	settings = sets.loadPrefs();
	
	login = settings['login'];
	pass = settings['pass'];
	hdOnly = new Boolean(settings['hdonly'] != "false");
	filterOn = new Boolean(settings['filterOn'] != "false");
	
	if(login != null && pass != null && (login.length > 1 && pass.length > 1) ){
		vkVideoSearch = new VkVideo(login, pass);
		vkVideoSearch.init();
	}else{
		Alert.show("Пожалуйста, задайте логин и пароль от Вконтакте.ру!", "Ошибка!");
		//sett_wnd.visible = true;
		showSetts = true;
	}	
}